package cn.lls.controller.ca;


import cn.lls.base.result.R;
import cn.lls.req.company.CompanyReq;
import cn.lls.service.ICompanyAllInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  公司注册控制器
 * </p>
 *
 * @author 划水艺术家
 * @since 2022-11-15
 */
@RestController
@RequestMapping("/ca/enroll")
@Slf4j
@Api(tags = "公司信息注册控制器")
public class CompanyEnrollController {

    @Autowired
    private ICompanyAllInfoService companyAllInfoService;

    @PostMapping
    @ApiOperation(value = "公司注册", notes = "公司输入相关信息完成注册", response = R.class, httpMethod = "POST")
    public R companyEnroll(
            @ApiParam(required = true, value = "公司实体信息")
            @RequestBody @Validated CompanyReq companyReq,
            BindingResult bindingResult) {
        companyReq.setCompanyStatus(0);
        companyAllInfoService.companyEnroll(companyReq);
        return R.success();
    }
}

